package com.zoranjoka.chordis.pages.edit;

import java.util.ArrayList;
import java.util.List;

import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.ioc.annotations.Inject;

import com.zoranjoka.chordis.dao.AlbumDAO;
import com.zoranjoka.chordis.dao.ArtistDAO;
import com.zoranjoka.chordis.entities.Album;
import com.zoranjoka.chordis.entities.AlbumBean;
import com.zoranjoka.chordis.entities.Artist;
import com.zoranjoka.chordis.entities.ArtistBean;
import com.zoranjoka.chordis.entities.SongBean;

public class EditAlbum {

	@Inject
	private ArtistDAO dataArtist;
	@Inject 
	private AlbumDAO dataAlbum;
	
	@Property
	private Artist artist;
	@Property
	private Album album;
	@Property
	private List<SongBean> songs;
	
	void onActivate(long id){
		artist = new ArtistBean();
		album = new AlbumBean();	
		songs = new ArrayList<SongBean>();
		album = dataAlbum.findById(id);
		artist = album.getArtist();
		songs = album.getSongs();
	}
	
	
		
}
